<?php defined('ROOT_DIR') or die('Access denied!');?>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="暮雨秋晨" />
	<meta charset="UTF-8" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1" />
    <meta name="description" content="<?php echo $config['desc'];?>" />
    <meta name="keywords" content="<?php echo $config['keywd'];?>" />
	<title><?php echo $title;?></title>
    <link rel="stylesheet" href="/Application/static/css/main.css" />
    <script src="/Application/static/js/common.js"></script>
</head>
<body>
<header>
<ul>
<li><a href="<?php echo $this->urlCreate('admin','index');?>" style="z-index: 50;">管理主页</a></li>
<li><a href="#" style="z-index: 49;">版块管理</a></li>
</ul>
</header>

<div id="main">
<div id="subtitle">主题管理</div>
<?php if(!empty($topics)):?>
<ol id="list">
<?php foreach($topics as $topic):?>

<li><?php echo $topic['title'];?>&nbsp;[ <a href="<?php echo $this->urlCreate('admin','topic_delete',array('id'=>$topic['id']));?>" onclick="return confirm('确定删除？');">删</a> | <a href="<?php echo $this->urlCreate('admin','topic_change',array('id'=>$topic['id']));?>">改</a> ]</li>

<?php endforeach;?>
</ol>
<div id="pages">
<?php if($nowpage!=1 && $pages>$nowpage):?>
<div style="border-top: 1px solid #eee;width: 97%;"><a href="<?php echo $next_url;?>">下一页</a>.<a href="<?php echo $last_url;?>">上一页</a><span style="margin-left: 1em;font-size: 12px;letter-spacing: 1px;">(<b><?php echo $nowpage;?></b>/<?php echo $pages;?>)</span></div>

<?php elseif($nowpage == $pages && $pages != 1):?>
<!--当前页面只有一页-->
<div style="border-top: 1px solid #eee;width: 97%;"><a href="<?php echo $last_url;?>">上一页</a><span style="margin-left: 1em;font-size: 12px;letter-spacing: 1px;">(<b><?php echo $nowpage;?></b>/<?php echo $pages;?>)</span></div>

<?php elseif($nowpage ==1 && $pages!=$nowpage):?>
<!--当前为第一页，总页数大于一-->
<div style="border-top: 1px solid #eee;width: 97%;"><a href="<?php echo $next_url;?>">下一页</a><span style="margin-left: 1em;font-size: 12px;letter-spacing: 1px;">(<b><?php echo $nowpage;?></b>/<?php echo $pages;?>)</span></div>

<?php endif;?>
</div>

<?php else:?>

<div style="font-size: 1.2em;color: #EE7700;margin: 1em 2em 1em;">暂无帖子</div>

<?php endif;?>
</div>
<footer>
&copy;<a href="http://www.doubear.com">Doubear</a> Driven by <a href="http://www.domvc.com">DoMVC</a> framework
</footer>
</body>
</html>